package com.xhwl.centiotdata.constant;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Copyright: Copyright (c) 2021  ALL RIGHTS RESERVED.
 * @Company: 深圳市兴海物联科技有限公司
 * @Author: gyc
 * @CreateDate: 2021/11/5 15:18
 * @UpdateDate: 2021/11/5 15:18
 * @UpdateRemark: init
 * @Version: 1.0
 */
public class EesdConstant {

    /**
     * 失败
     * 调用成功值
     */
    public static final String SUCCESS_1000_CODE = "1000";
    public static final Integer SUCCESS_200_CODE = 200;
    public static final String SUCCESS_200_STR_CODE = "200";
    public static final String SUCCESS_0_Str_CODE = "0";
    public static final Integer NUM_0 = 0;
    public static final Integer NUM_1 = 1;
    public static final Integer NUM_6 = 6;

    /**
     * 默认值
     */
    public static final Double DEFAULT_0D_VALUE = 0D;
    public static final String NUM_0_STR_2 = "0.00";
    public static final String NANTOU_V2G = "11070508210827001";


    /**
     * 状态值
     */
    public static final String ONLINE_TRUE_STATUS = "true";
    public static final String ONLINE_STR_STATUS = "在线";
    public static final Integer ONLINE_STATUS = 1;
    public static final Integer OFFLINE_STATUS = 0;

    /**
     * iot使用值
     */
    public static final String USED = "used";
    /**
     * data
     */
    public static final String DATA = "data";
    public static final String RESULT = "result";
    public static final String CODE = "code";
    public static final String TOTAL = "total";
    public static final String RECORDS = "records";


    /**
     * eesd系统key键
     */
    public static final String EESD_GROWATT_INFO_KEY = "eesd_growatt_info";
    public static final String EESD_CONFIG = "eesd_config";

    public static final String EESD_UNDERSCORE = "_";
    /**
     * 光伏
     */

    public static final String GROWATT_PLANT = "growatt_plant";
    public static final String GROWATT_USER_LIST = "growatt_user_list";
    public static final String GROWATT_PLANT_LIST = "growatt_plant_list";
    public static final String GROWATT_PLANT_DATA = "growatt_plant_data";
    public static final String GROWATT_USER_PLANT_LIST = "growatt_user_plant_list";
    public static final String GROWATT_DEVICE_DATALOGGER_LIST = "growatt_device_datalogger_list";
    public static final String GROWATT_DEVICE_LIST = "growatt_device_list";
    public static final String GROWATT_INVERTER_REAL_TIME = "growatt_inverter_real_time";
    public static final String GROWATT_ENV_REAL_TIME = "growatt_env_real_time";
    public static final String GROWATT_ENV = "growatt_env";
    public static final String GROWATT_INVERTER_ALARM = "growatt_inverter_alarm";

    public static final String SERIES = "growatt:series:";

    public static final String GROWATT_V = "getVString";
    public static final String GROWATT_A = "getCurrentString";
    /**
     * 充电桩
     */
    public static final String QI_MING_TOKEN = "eesd_qi_ming_token";
    public static final String QI_MING_ALL_TOKEN = "eesd_qi_ming_all_token";
    public static final String QI_MING_QUERY_STATIONS_INFO = "eesd_qi_ming_query_stations_info";
    public static final String QI_MING_QUERY_STATIONS_STATUS = "eesd_qi_ming_query_stations_status";
    public static final String QI_MING_QUERY_STATIONS_STATS = "eesd_qi_ming_query_stations_stats";
    public static final String QI_MING_QUERY_EQUIP_CHARGE_STATUS = "eesd_qi_ming_query_equip_charge_status";

    /**
     * 鉴权请求头
     */
    public static final String HEADER_TOKEN = "token";

    /**
     * 请求url
     */
    public static final String HOST = "host";
    public static final String USER_URL = "userUrl";
    public static final String PLANT_URL = "plantUrl";
    public static final String PLANT_DATA_URL = "plantDataUrl";
    public static final String DEVICE_URL = "deviceUrl";
    public static final String DATALOGGER_LIST_URL = "dataloggerListUrl";


    /**
     * 缓存时间
     */
    public static final int FIVE_MINUTE = 5;
    public static final int TEN_MINUTE = 10;
    public static final int FIFTEEN_MINUTE = 15;
    public static final int HALF_AN_HOUR = 30;
    public static final int FIVE_HOUR = 5 * 60;
    public static final int ONE_DAY = 24 * 60;


    public static final String EESD_DEVICE_TYPE_CODE = "deviceTypeCode";
    public static final String EESD_DEVICE_TYPE_ID = "deviceTypeId";
    public static final String PRODUCT_ID = "productId";
    public static final String PRODUCT_CODE = "productCode";

    /**
     * 兴海iot接口默认请求页和数量
     */
    public static final int PAGE_NUM = 1;
    public static final int SIZE = 100;


    /**
     * 风速和风力等级映射表
     */
    public static Map<Integer, String> windSpeedMap = new HashMap() {{
        put(0, "0~0.2");
        put(1, "0.3~1.5");
        put(2, "1.6~3.3");
        put(3, "3.4~5.4");
        put(4, "5.5~7.9");
        put(5, "8~10.7");
        put(6, "10.8~13.8");
        put(7, "13.9~17.1");
        put(8, "17.2~20.7");
        put(9, "20.8~24.4");
        put(10, "24.5~28.4");
        put(11, "28.5~32.6");
        put(12, "32.6~999.9");
    }};
    /**
     * 空气质量
     */
    public static List<Map<String, Object>> aqi = new LinkedList<Map<String, Object>>() {{
        add(
                new HashMap() {{
                    put("begin", -1000);
                    put("end", -1);
                    put("val", "异常");
                }}
        );
        add(
                new HashMap() {{
                    put("begin", 0);
                    put("end", 50);
                    put("val", "优");
                }}
        );
        add(
                new HashMap() {{
                    put("begin", 51);
                    put("end", 100);
                    put("val", "良好");
                }}
        );
        add(
                new HashMap() {{
                    put("begin", 101);
                    put("end", 150);
                    put("val", "轻度污染");
                }}
        );
        add(
                new HashMap() {{
                    put("begin", 151);
                    put("end", 200);
                    put("val", "中度污染");
                }}
        );
        add(
                new HashMap() {{
                    put("begin", 201);
                    put("end", 300);
                    put("val", "重度污染");
                }}
        );
        add(
                new HashMap() {{
                    put("begin", 301);
                    put("end", 500);
                    put("val", "严重污染");
                }}
        );
        add(
                new HashMap() {{
                    put("begin", 501);
                    put("end", 100000);
                    put("val", "爆表");
                }}
        );
    }};
}
